#ifndef __RBUFFER_D_H_
#define __RBUFFER_D_H_
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct {
    void *unused;
}*rbuffer_handle_t;

typedef struct {
    uint32_t buffer_size;
    void *static_mem;
}rbuffer_config_t;

uint32_t rbuffer_data_len(rbuffer_handle_t handle);

uint32_t rbuffer_data_len_set(rbuffer_handle_t handle, uint32_t length);

uint8_t rbuffer_end_flag_get(rbuffer_handle_t handle);

uint8_t rbuffer_end_flag_set(rbuffer_handle_t handle);

int32_t is_rbuffer_empty(rbuffer_handle_t handle);

int32_t is_rbuffer_full(rbuffer_handle_t handle);

void *rbuffer_mempool_get(rbuffer_handle_t handle);

int32_t rbuffer_put_char(rbuffer_handle_t handle, const uint8_t ch);

int32_t rbuffer_put_str(rbuffer_handle_t handle, const uint8_t *w_str, uint16_t length);

int32_t rbuffer_get_char(rbuffer_handle_t handle, uint8_t *ch);

int32_t rbuffer_get_str(rbuffer_handle_t handle, uint8_t *r_str, uint16_t length);

int32_t rbuffer_get_size(rbuffer_handle_t handle);

rbuffer_handle_t rbuffer_create(rbuffer_config_t *config);

int32_t rbuffer_destroy(rbuffer_handle_t handle);

#ifdef __cplusplus
}
#endif

#endif

